< previous page page_590 next page >

Page 590
9f31265bb40b592b1929e18a47ab28e5.gif
   If mstrSection <> "" Then
      strBuffer = Space(2048)

      lngRet = GetPrivateProfileSection( _
                        mstrSection, _
                        strBuffer, _
                        Len(strBuffer), _
                        mstrConfigName)
      If lngRet > 0 Then
         strBuffer = Left$(strBuffer, lngRet)
         SectionGet = Split(strBuffer, Chr$(0))
      Else
         SectionGet = Array()
      End If
   End If
End Function
Using this INI class should save you quite a bit of time, as opposed to using the Windows API calls. In addition, if you ever want to change how you get at the information, all you need to do is to change the internals of each of the methods. You dont need to change your front-end application at all.
The System Registry
The System Registry plays the same role as INI filesit stores application information. The Registry is a hierarchical database of information thats represented by root keys (sometimes called hives), keys, and subkeys. This is very similar to the directory structure that DOS uses.
The Registry holds a lot of information about your machine configuration and about most of the applications that have been installed on your computer. In Windows 3.1, very little information is stored in the Registry because most of the information is stored in INI files. In Windows 95, a combination of INI files and Registry entries are used. In Windows NT, almost all the information about the system is stored in the Registry. As you can see, as you move to the more robust operating systems, the Registry becomes increasingly important.
Table 29.3 shows the root keys in Windows NT 4.0. These root keys are very similar under Windows 95 and Windows 98.

 
< previous page page_590 next page >

If you like this book, buy it!